import { useSelector, useDispatch } from "react-redux";

export default function usePrevious() {
    const state = useSelector(state => state);
    const dispatch = useDispatch();
    const changeHistoryArr: any = (data: any, type: string): void => {
        dispatch({
            type,
            data
        })
    }
    return [state, changeHistoryArr];
};